{% set classes = expl.transition_features.class_names %}
{% set coef = expl.transition_features.coef %}

<table class="eli5-transition-features" style="margin-bottom: 0.5em;">
    <thead>
        <tr>
            <td>From \ To</td>
            {% for class_name in classes %}
                <th>{{ class_name|e }}</th>
            {% endfor %}
        </tr>
    </thead>
    <tbody>
        {% with weight_range = numpy.abs(coef).max() %}
            {% for class_from, row in zip(classes, coef) %}
                <tr>
                    <th>{{ class_from|e }}</th>
                    {% for class_to, value in zip(classes, row) %}
                        <td style="background-color: {{ value|weight_color(weight_range) }}" title="{{ class_from|e }} &rArr; {{ class_to|e }}">
                            {{ value | round(3) }}
                        </td>
                    {% endfor %}
                </tr>
            {% endfor %}
        {% endwith %}
    </tbody>
</table>
